<%@ page language="java" import="java.util.*,cn.ac.cintcm.dataconverge.researchsubject.domain.*" pageEncoding="UTF-8"%>
<%@page import="com.hs.core.page.*,com.hs.core.utils.*"%>
<%@page import="cn.ac.cintcm.dataconverge.util.Constants;"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

List resultList = null;
String pageStr = ""; 
Subject subject = (Subject)request.getAttribute("subject");
QueryPage query = (QueryPage)request.getAttribute("query");
int perpageCount = query.getPerpagenum();
int currentPage = query.getCurrentPageNo(); 
   resultList = (List)request.getAttribute("hisList");
   pageStr = (String)request.getAttribute("pageStr");
%><html>
  <head>
  	<TITLE><%=Constants.APP_TITLE %>--课题评审历史</TITLE>
   <link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
     <script src="<%=basePath%>js/common.js" language="javascript" type="text/javascript"></script>
     <script language="javascript" src="<%=path %>/js/check.js"></script>
    <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script> 
	<SCRIPT type="text/javascript">
	function modifyUser(value) {
	        //var bln = window.confirm("确定要修改吗？", "确定", "取消");
	        //if(bln == true) {
//	        var page=document.all.ec_p.value;
 			var page = 5;
			url = "expert.htm?action=expertModify&flag=mod&ids=" + value;
			openwindow(url,'700','600','');
			//}
		}
	
	function deleteUser(value) {
		var bln = window.confirm("确定要删除此专家吗？", "确定", "取消");
		if(bln == true) { 
			url = "expert.htm?action=delExpert&ids=" + value; 
			form1.action=url;
			searchform.submit();
		}
	}
	function deleteHis(id){
	   if(confirm("确认要删除该评审记录吗？")){
	      subject.delExpert(id,callBackDel);
	   }
	   
	}
	function callBackDel(message){
	  alert("删除成功");
	  if(window.opener.pageForm)
			window.opener.pageForm.submit();
	  window.location.replace(document.location.href);
	}
	 
	</SCRIPT>
</head>
  
 <body  scroll="yes">
      <div class="r_rtm_tb_mg1">
        <div class="r_rtm_tb1">
            <img src="<%=basePath%>index/Themes/com/idt_tb_pass.gif" />&nbsp;评审历史管理
        </div>
    </div>
     <table cellspacing="2" cellpadding="0" width="100%" class="idt_item_mg" id="Table2">
     <tbody> 
        <tr>
		 
         <td class="fim_l">课题名称:</td>
            <td class="fim_r"  >
               <%=StringUtilTool.setObjNULLStr(subject.getSubjectname()) %></td>
           <td class="fim_l">课题状态:</td>
              <td class="fim_r" align="right" nowrap="nowrap"  > 
             <font color="red"><%=Constants.getSubjectStatus(subject==null?"":subject.getState()) %></font>
            </td>
        </tr> </tbody>
    </table>
    <div class="content">
        <table width="*" cellpadding="0" cellspacing="1" class="dg_borderstyle" id="Table4" >
            <tr>
                <td class="dg_headerstyle">
                    序号</td>   
                <td class="dg_headerstyle">
                 评审类型</td>
                   
                      <td class="dg_headerstyle">
                  评审人
                     </td>
                    
                      <td class="dg_headerstyle">
                  评审状态
                     </td>
                    
                      <td class="dg_headerstyle">
                  评审意见
                    </td>
                    
                      <td class="dg_headerstyle">
                 评审结果
                    </td> 
                     <td class="dg_headerstyle">
                 评审日期
                    </td> 
                     
                 <td class="dg_headerstyle">删除</td>
            </tr>
            <% 
            if(resultList != null && resultList.size()>0){ 
            	for(int i = 0;i<resultList.size();i++){
	            	Map data = (Map)resultList.get(i); 
            %>
            <tr class="dg_alternatingitemstyle" onmouseover="ChangeRowBg(this);" onmouseout="ChangeRowBg(this);" onmouseup="ChangeRowBg(this);" onmousedown="ChangeRowBg(this);">
                <td align="center">
                    <%=(i+1)+perpageCount*(currentPage-1) %></td> 
                    <td align="center">
                     <%=data.get("SYNTYPE") %>
                </td>
                <td align="center">
                     <%=data.get("NAME") %>
                </td> 
                   <td align="center">
                    <%
                                String status = data.get("AUDITSTATUS")+"";
                                if("0".equals(status))
                                   out.println("未评审"); 
                                else
                               	 out.println("已评审"); 
                                %> 
                </td> 
                   <td >
                    <%=StringUtilTool.setObjNULLStr(data.get("EXPERT_OPINION")==null?"":data.get("EXPERT_OPINION")) %>
                </td>
                
                   <td align="center"><font color="red">
                    <%
                                 String result = data.get("EXPERT_RESULT")+"";
                                 if("1".equals(result))
                                    out.println("不通过");
                                 if("2".equals(result))
                                     out.println("通过");
                                 %>
                                 </font>
                </td> 
                   <td>
                   <%= Tools.getDateStringByDate1((Date)data.get("STARTDATE")) %>
                </td>
                 
                <td align="center">
                 <% if("0".equals(status)){ %>
                <img style="cursor: hand" src="<%=basePath%>index/Themes/com/68design.net_registration1_(delete)_16x16.gif" onclick="javascript:deleteHis('<%=data.get("ID") %>');"
               alt="删除" />
               <%} %>
                </td>
            </tr>
            <%}}else{ %>
            <tr class="dg_alternatingitemstyle">
                 <td colspan="10" align="center"><font color="red">没有记录</font></td>
            </tr> 
            <%} %>
        </table>
        <div class="dg_pagerstyle" align="right">
        	<%=pageStr%>
        </div>
    </div>
  </body>
</html>
